<%@ page language="java" import="java.util.*,entity.*,dao.*,dao.impl.*,biz.*,biz.impl.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	request.setCharacterEncoding("GBK");
	String userName = request.getParameter("userName");//取得请求中的登录名
	String userPass = request.getParameter("userPass");//取得请求中的密码
	
	UserDao userDao = new UserDaoImpl();//取得用户Dao的实例
	User user = userDao.findUser(userName);//根据请求的登录名和密码查找用户 
	
	UserBiz userBiz = new UserBizImpl();//得到用户Biz的实例*/ 
%>

<%-- <!-- 实例化UserBizImpl对象 -->
<jsp:userBean id="UserBiz" type="biz.UserBiz" class="biz.impl.UserBizImpl" scope="page"/>
<!-- 实例化User对象 -->
<jsp:userBean id="user" class="entity.User" scope="session"/>
<!-- 接收表单参数 -->
<jsp:setProperty property="*" name="user"/> --%>


<%
	User tempUser = userBiz.findUser(user.getUserName());//根据请求的登录名和密码查找用户
	//User user = userBiz.findUser(userName);//根据请求的登录名和密码查找用户
	
	if(user!=null&&user.getUserPass().equals(tempUser.getUserPass())){
		session.setAttribute("user",user);
		out.println("登录成功");
	}else{
		out.println("登陆失败");
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">  
    <title>doLogin.jsp</title>
  </head> 
  <body>
  </body>
</html>
